home *** CD-ROM | disk | FTP | other *** search
/ Programming a Multiplayer FPS in DirectX / Programming a Multiplayer FPS in DirectX (Companion CD).iso / DirectX / dxsdk_oct2004.exe / dxsdk.exe / Utilities / Content Creation Tool Plug-Ins / Maya / Binary5 / Scripts / AEDirectXShaderTemplate.mel next >
Encoding:
Text File  |  2004-09-27  |  1.7 KB  |  85 lines

  1. global string $DirectXShaderName = "";
  2.  
  3.  
  4. proc string plugNode( string $plug )
  5. {
  6.     string $buffer[];
  7.     tokenize($plug, ".", $buffer);
  8.     return $buffer[0];
  9. }
  10.  
  11. global proc FireUpEffectDialog( string $nodeName )
  12. {
  13.     setAttr ($nodeName+".Command") -type "string" "open";
  14. }
  15.  
  16.  
  17. global proc AEDirectXNew( string $messagePlug )
  18. {
  19.      global string $DirectXShaderName;
  20.     string $shaderNode = plugNode($messagePlug);
  21.     
  22.     string $parent = `setParent -q`;
  23.  
  24.      setUITemplate -pushTemplate attributeEditorTemplate;
  25.  
  26.     if ($DirectXShaderName == "" 
  27.         || !`iconTextButton -exists $DirectXShaderName`) 
  28.     {
  29.         $DirectXShaderName = `iconTextButton
  30.             -image1 "render_DirectXShader.xpm" 
  31.             -label "Select and Customize FX-File"
  32.             -style "iconAndTextVertical"
  33.             -height 64 -width 192`;     
  34.  
  35.     }
  36.  
  37.     setUITemplate -popTemplate;
  38.  
  39.  
  40.         AEDirectXReplace($messagePlug);
  41. }
  42.  
  43. global proc AEDirectXReplace( string $messagePlug )
  44. {
  45.     global string $DirectXShaderName;
  46.     string $shaderNode = plugNode($messagePlug);
  47.  
  48.     iconTextButton -e 
  49.         -command ("FireUpEffectDialog "+$shaderNode)
  50.         $DirectXShaderName;    
  51.     
  52. }
  53.  
  54. global proc AEDirectXShaderTemplate ( string $nodeName )
  55. {
  56.     AEswatchDisplay $nodeName;
  57.     
  58.     //layout 
  59.     editorTemplate -beginScrollLayout;    
  60.  
  61.         editorTemplate -beginLayout "Direct3D" -collapse 0;
  62.             editorTemplate -callCustom AEDirectXNew AEDirectXReplace $nodeName;
  63.             editorTemplate -addControl "color";
  64.             editorTemplate -addControl "File";
  65.         editorTemplate -endLayout;
  66.  
  67.  
  68.         //editorTemplate -beginLayout "Command Line" -collapse 0;
  69.         //    editorTemplate -addControl "Command";
  70.         //editorTemplate -endLayout;
  71.     
  72.         
  73.         editorTemplate -addExtraControls;
  74.     
  75.     editorTemplate -endScrollLayout;
  76. }
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.